home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / T / Think-Pascal-7.0.cpt / THINK Pascal Interfaces / Picker.p < prev    next >
Encoding:
Text File  |  1991-04-05  |  2.0 KB  |  97 lines  |  [TEXT/PJMM]

  1. {    This file has been processed by The THINK Pascal Source Converter, v1.1.    }
  2.  
  3. {
  4. Created: Friday, October 20, 1989 at 8:56 AM
  5.     Picker.p
  6.     Pascal Interface to the Macintosh Libraries
  7.  
  8.     Copyright Apple Computer, Inc.    1987-1989
  9.     All rights reserved
  10. }
  11.  
  12.  
  13. {$IFC UNDEFINED UsingIncludes}
  14. {$SETC UsingIncludes := 0}
  15. {$ENDC}
  16.  
  17.  
  18.     UNIT Picker;
  19.     INTERFACE
  20.     USES
  21.         Types, Quickdraw;
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35. CONST
  36.  
  37. {
  38.  
  39. }
  40.  
  41. MaxSmallFract = $0000FFFF;        {Maximum small fract value, as long}
  42.  
  43.  
  44. TYPE
  45.  
  46. SmallFract = INTEGER;
  47.  
  48. HSVColor = RECORD
  49.     hue: SmallFract;            {Fraction of circle, red at 0}
  50.     saturation: SmallFract;     {0-1, 0 for gray, 1 for pure color}
  51.     value: SmallFract;            {0-1, 0 for black, 1 for max intensity}
  52.     END;
  53.  
  54. { For developmental simplicity in switching between the HLS and HSVmodels, HLS
  55.  is reordered into HSL.  Thus both models start with hue and saturation values;
  56.  value/lightness/brightness is last.}
  57. HSLColor = RECORD
  58.     hue: SmallFract;            {Fraction of circle, red at 0}
  59.     saturation: SmallFract;     {0-1, 0 for gray, 1 for pure color}
  60.     lightness: SmallFract;        {0-1, 0 for black, 1 for white}
  61.     END;
  62.  
  63. CMYColor = RECORD
  64.     cyan: SmallFract;
  65.     magenta: SmallFract;
  66.     yellow: SmallFract;
  67.     END;
  68.  
  69.  
  70.  
  71. FUNCTION Fix2SmallFract(f: Fixed): SmallFract;
  72.     INLINE $3F3C,$0001,$A82E;
  73. FUNCTION SmallFract2Fix(s: SmallFract): Fixed;
  74.     INLINE $3F3C,$0002,$A82E;
  75. PROCEDURE CMY2RGB(cColor: CMYColor;VAR rColor: RGBColor);
  76.     INLINE $3F3C,$0003,$A82E;
  77. PROCEDURE RGB2CMY(rColor: RGBColor;VAR cColor: CMYColor);
  78.     INLINE $3F3C,$0004,$A82E;
  79. PROCEDURE HSL2RGB(hColor: HSLColor;VAR rColor: RGBColor);
  80.     INLINE $3F3C,$0005,$A82E;
  81. PROCEDURE RGB2HSL(rColor: RGBColor;VAR hColor: HSLColor);
  82.     INLINE $3F3C,$0006,$A82E;
  83. PROCEDURE HSV2RGB(hColor: HSVColor;VAR rColor: RGBColor);
  84.     INLINE $3F3C,$0007,$A82E;
  85. PROCEDURE RGB2HSV(rColor: RGBColor;VAR hColor: HSVColor);
  86.     INLINE $3F3C,$0008,$A82E;
  87. FUNCTION GetColor(where: Point;prompt: Str255;inColor: RGBColor;VAR outColor: RGBColor): BOOLEAN;
  88.     INLINE $3F3C,$0009,$A82E;
  89.  
  90.     { UsingPicker }
  91.  
  92.  
  93.     IMPLEMENTATION
  94. END.
  95.  
  96.  
  97.